-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Remove use of deprecated security.exception_listener.class parameter #7898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
security/target_path.rst
Outdated
First, override the ``security.exception_listener.class`` parameter in your | ||
configuration file. This can be done from your main configuration file (in | ||
``app/config``) or from a configuration file being imported from a bundle: | ||
First, add a ``CompilerPass`` which you will use to override the ``ExceptionListener`` class:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[...] add a compiler pass which [...]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and I would write "to replace" instead of "to override"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used override because that's the terminology from here: https://symfony.com/doc/current/bundles/override.html
But happy to change it :)
security/target_path.rst
Outdated
} | ||
|
||
Next, create the ``ExceptionListenerPass`` to replace the definition of ``ExceptionListener``. | ||
Make sure you use the name of the firewall you have configured in ``app/config``:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe: "[...] in your security configuration."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does sound better, I'll change it.
security/target_path.rst
Outdated
{ | ||
// Use the name of your firewall as suffix e.g. 'secured_area' | ||
$definition = $container->getDefinition('security.exception_listener.secured_area'); | ||
$definition->setClass('AppBundle\Security\Firewall\ExceptionListener'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could use the class
constant here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, I much prefer class
constants too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, I just left some minor comments which we could also address while merging
I would like to reorder this, first would make the |
@yceruto yeah I thought about ordering it that way, it makes more sense to implement as well because you get autocompletion from your IDE, I only went this way to be consistent with how it was before. I'm happy to reorder though, if we're not worried about keeping the same order as before? Also, do you know why platformsh is failing? I get a 404 from the link. |
@xabbuh I've made the changes you suggested, thanks for the review 😄 |
Reordering indeed was a good move. :) |
Ok I've done the reordering, it does seem more intuitive. |
Thank you @ndench. |
…s parameter (ndench) This PR was submitted for the 3.2 branch but it was merged into the 2.7 branch instead (closes #7898). Discussion ---------- Remove use of deprecated security.exception_listener.class parameter Reference: symfony/symfony#15534 Commits ------- 6fc36d0 Remove use of deprecated security.exception_listener.class parameter
|
||
use AppBundle\DependencyInjection\Compiler\ExceptionListenerPass; | ||
|
||
class AppBundle extends Bundle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use the kernel instead as of 3.3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HeahDude what do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean using https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Kernel.php#L446 instead, but this is not the good place to ask, and I guess will be part of a bigger update to get rid of AppBundle in the docs. So never mind :)
Reference: symfony/symfony#15534